'''
Created on 27/apr/09

@author: Riccardo Cagnasso
'''

import os

from Controller.AuthHandler import AuthHandler
from Datastore.Ticket.Ticket import Ticket


class TicketList(AuthHandler):
    def get(self):
        super(TicketList,self).get()
        self.response.headers['Content-Type'] = 'text/html'
        tickets = Ticket.all()
        
        template_vars={
                        'tickets':tickets
                       }
                #self.response.out.write( entry.key() )
                
        path = os.path.join(os.path.dirname(__file__), '..','templates','listTickets.html')
        #self.response.out.write(path)
        self.response.out.write(self.displayTemplate(path, template_vars))
                